//
//  HLOriginController.swift
//  MyBlog
//
//  Created by 李芙蓉 on 16/3/4.
//  Copyright © 2016年 hanlei. All rights reserved.
//

import UIKit

class HLOriginController: UITableViewController {
    
        
    var isVisitor : Bool = false
    
    override func loadView() {
        
        if isVisitor {

            view = HLVisitorView()
            
            setupNavigationItem()
            
        } else {
            
            super.loadView()
        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    //加载navigationItem
    private func setupNavigationItem () {
        
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登录", target: self, action: "loginButtonDidClick")
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "注册", target: self, action: "registerButtonDidClick")
    }
    
    //登录按钮点击事件
    @objc private func loginButtonDidClick () {
        
        presentViewController(HLTempNavigationController(rootViewController:HLWebViewController()), animated: true, completion: nil)
    }
    
    //注册按钮点击事件
    @objc private func registerButtonDidClick () {
        
    }
}
